package homework.day10;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * 将整数1-100存入一个List集合中并输出
 * 之后将集合中40-60的元素翻转后并输出
 * 
 * @author Xiloer
 *
 */
public class Test04 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for(int i=1;i<=100;i++){
            list.add(i);
        }
        System.out.println(list);

        List<Integer> in = list.subList(39,60);
        System.out.println(in);
//        Collections.reverse(in);//反转
//        System.out.println(in.size());

        for(int i =0;i<in.size()/2;i++){
            Integer ir = in.get(i);
            System.out.println(ir);
            ir = in.set(in.size()-1-i,ir);
            in.set(i,ir);
        }
        System.out.println(in);
        System.out.println(list);


    }
}
